import socket

# 创建tcp套接字
tcp_socket = socket.socket(family=socket.AF_INET, type=socket.SOCK_STREAM)
# 连接服务器
server_ip = "192.168.34.41"
#server_ip = "192.168.34.28"#组长
#server_ip = "192.168.34.25"自己
server_port = 8866
tcp_socket.connect((server_ip, server_port))

# 发送数据
num = input(f"{server_ip}:{server_port}<< ")
tcp_socket.send(str(num).encode("utf-8"))
# 接收数据
recv_data = tcp_socket.recv(1024)
print(f"{server_ip}:{server_port}>> {recv_data.decode('utf-8')}")

# 关闭套接字
tcp_socket.close()